home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / camera1.bas < prev    next >
Encoding:
BASIC Source File  |  2001-10-16  |  9.3 KB  |  406 lines

  1. Attribute VB_Name = "CameraMethods"
  2. '******************************************************************'
  3. '*                                                                *'
  4. '*                      TurboCAD for Windows                      *'
  5. '*                   Copyright (c) 1993 - 2001                    *'
  6. '*             International Microcomputer Software, Inc.         *'
  7. '*                            (IMSI)                              *'
  8. '*                      All rights reserved.                      *'
  9. '*                                                                *'
  10. '******************************************************************'
  11.  
  12. Public Sub Camera_Plan(ByVal TheView As View)
  13.     If (TheView.SpaceMode = imsiPaperSpace) Then
  14.         MsgBox "Camera's properties can be changed only in model space"
  15.         Exit Sub
  16.         'Camera's properties can be changed only in model space
  17.     End If
  18.     Dim Cam1 As Object 'Camera   'IMSIGX.XCamera
  19.     Dim Vpos As XVertex
  20.     Dim VLookAt As Vertex
  21.     Dim VerUp As Vertex
  22.  
  23.     Set Cam1 = TheView.Camera
  24.     Set Vpos = New XVertex
  25.     Set VLookAt = Vpos.Duplicate
  26.     Set VerUp = Vpos.Duplicate
  27.     
  28.     Vpos.X = 0
  29.     Vpos.Y = 0
  30.     Vpos.Z = 1
  31.     
  32.     VLookAt.X = 0
  33.     VLookAt.Y = 0
  34.     VLookAt.Z = 0
  35.     
  36.     VerUp.X = 0
  37.     VerUp.Y = 1
  38.     VerUp.Z = 0
  39.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  40.     TheView.Refresh
  41.     TheView.ZoomToExtents
  42.     TheView.Update = False
  43. Set VerUp = Nothing
  44. Set Vpos = Nothing
  45. Set VLookAt = Nothing
  46. Set Cam1 = Nothing
  47.  
  48. End Sub
  49. Public Sub Camera_Right(TheView As View)
  50.     If (TheView.SpaceMode = imsiPaperSpace) Then
  51.         MsgBox "Camera's properties can be changed only in model space"
  52.         Exit Sub
  53.         'Camera's properties can be changed only in model space
  54.     End If
  55.     Dim Cam1 As XCamera
  56.     Dim Vpos As XVertex
  57.     Dim VLookAt As Vertex
  58.     Dim VerUp As Vertex
  59.     
  60.     Set Cam1 = TheView.Camera
  61.     Set Vpos = New XVertex
  62.     Set VLookAt = Vpos.Duplicate
  63.     Set VerUp = Vpos.Duplicate
  64.     
  65.     Vpos.X = 1
  66.     Vpos.Y = 0
  67.     Vpos.Z = 0
  68.     
  69.     VLookAt.X = 0
  70.     VLookAt.Y = 0
  71.     VLookAt.Z = 0
  72.     
  73.     VerUp.X = 0
  74.     VerUp.Y = 0
  75.     VerUp.Z = 1
  76.     
  77.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  78.     TheView.ZoomToExtents
  79.     TheView.Refresh
  80.     
  81. Set VerUp = Nothing
  82. Set Vpos = Nothing
  83. Set VLookAt = Nothing
  84. Set Cam1 = Nothing
  85.  
  86. End Sub
  87.  
  88.  
  89. Public Sub Camera_Left(TheView As View)
  90.   If (TheView.SpaceMode = imsiPaperSpace) Then
  91.         MsgBox "Camera's properties can be changed only in model space"
  92.         Exit Sub
  93.         'Camera's properties can be changed only in model space
  94.   End If
  95.     Dim Cam1 As XCamera
  96.     Dim Vpos As XVertex
  97.     Dim VLookAt As Vertex
  98.     Dim VerUp As Vertex
  99.     
  100.     Set Cam1 = TheView.Camera
  101.     Set Vpos = New XVertex
  102.     Set VLookAt = Vpos.Duplicate
  103.     Set VerUp = Vpos.Duplicate
  104.     
  105.     Vpos.X = -1
  106.     Vpos.Y = 0
  107.     Vpos.Z = 0
  108.     
  109.     VLookAt.X = 0
  110.     VLookAt.Y = 0
  111.     VLookAt.Z = 0
  112.     
  113.     VerUp.X = 0
  114.     VerUp.Y = 0
  115.     VerUp.Z = 1
  116.     
  117.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  118.     TheView.ZoomToExtents
  119.     TheView.Refresh
  120.     
  121. Set VerUp = Nothing
  122. Set Vpos = Nothing
  123. Set VLookAt = Nothing
  124. Set Cam1 = Nothing
  125.  
  126. End Sub
  127.  
  128. Public Sub Camera_Front(TheView As View)
  129.   If (TheView.SpaceMode = imsiPaperSpace) Then
  130.         MsgBox "Camera's properties can be changed only in model space"
  131.         Exit Sub
  132.         'Camera's properties can be changed only in model space
  133.   End If
  134.     Dim Cam1 As XCamera
  135.     Dim Vpos As XVertex
  136.     Dim VLookAt As Vertex
  137.     Dim VerUp As Vertex
  138.     
  139.     Set Cam1 = TheView.Camera
  140.     Set Vpos = New XVertex
  141.     Set VLookAt = Vpos.Duplicate
  142.     Set VerUp = Vpos.Duplicate
  143.     
  144.     Vpos.X = 0
  145.     Vpos.Y = -1
  146.     Vpos.Z = 0
  147.     
  148.     VLookAt.X = 0
  149.     VLookAt.Y = 0
  150.     VLookAt.Z = 0
  151.     
  152.     VerUp.X = 0
  153.     VerUp.Y = 0
  154.     VerUp.Z = 1
  155.     
  156.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  157.     TheView.ZoomToExtents
  158.     TheView.Refresh
  159.     
  160. Set VerUp = Nothing
  161. Set Vpos = Nothing
  162. Set VLookAt = Nothing
  163. Set Cam1 = Nothing
  164.  
  165. End Sub
  166.  
  167.  
  168. Public Sub Camera_Back(TheView As View)
  169.   If (TheView.SpaceMode = imsiPaperSpace) Then
  170.         MsgBox "Camera's properties can be changed only in model space"
  171.         Exit Sub
  172.         'Camera's properties can be changed only in model space
  173.   End If
  174.     Dim Cam1 As XCamera
  175.     Dim Vpos As XVertex
  176.     Dim VLookAt As Vertex
  177.     Dim VerUp As Vertex
  178.     
  179.     Set Cam1 = TheView.Camera
  180.     Set Vpos = New XVertex
  181.     Set VLookAt = Vpos.Duplicate
  182.     Set VerUp = Vpos.Duplicate
  183.     
  184.     Vpos.X = 0
  185.     Vpos.Y = 1
  186.     Vpos.Z = 0
  187.     
  188.     VLookAt.X = 0
  189.     VLookAt.Y = 0
  190.     VLookAt.Z = 0
  191.     
  192.     VerUp.X = 0
  193.     VerUp.Y = 0
  194.     VerUp.Z = 1
  195.     
  196.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  197.     TheView.ZoomToExtents
  198.     TheView.Refresh
  199.     
  200. Set VerUp = Nothing
  201. Set Vpos = Nothing
  202. Set VLookAt = Nothing
  203. Set Cam1 = Nothing
  204.  
  205. End Sub
  206.  
  207. Public Sub Camera_Bottom(TheView)
  208.   If (TheView.SpaceMode = imsiPaperSpace) Then
  209.         MsgBox "Camera's properties can be changed only in model space"
  210.         Exit Sub
  211.         'Camera's properties can be changed only in model space
  212.   End If
  213.     Dim Cam1 As XCamera
  214.     Dim Vpos As XVertex
  215.     Dim VLookAt As Vertex
  216.     Dim VerUp As Vertex
  217.     
  218.     Set Cam1 = TheView.Camera
  219.     Set Vpos = New XVertex
  220.     Set VLookAt = Vpos.Duplicate
  221.     Set VerUp = Vpos.Duplicate
  222.     
  223.     Vpos.X = 0
  224.     Vpos.Y = 0
  225.     Vpos.Z = 1 '-1
  226.     
  227.     VLookAt.X = 0
  228.     VLookAt.Y = 0
  229.     VLookAt.Z = 0
  230.     
  231.     VerUp.X = 0
  232.     VerUp.Y = -1 '1
  233.     VerUp.Z = 0
  234.     
  235.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  236.     TheView.ZoomToExtents
  237.     TheView.Refresh
  238.     
  239. Set VerUp = Nothing
  240. Set Vpos = Nothing
  241. Set VLookAt = Nothing
  242. Set Cam1 = Nothing
  243.  
  244. End Sub
  245. Public Sub Camera_ISO_SE(TheView As View)
  246.   If (TheView.SpaceMode = imsiPaperSpace) Then
  247.         MsgBox "Camera's properties can be changed only in model space"
  248.         Exit Sub
  249.         'Camera's properties can be changed only in model space
  250.   End If
  251.     Dim Cam1 As XCamera
  252.     Dim Vpos As XVertex
  253.     Dim VLookAt As Vertex
  254.     Dim VerUp As Vertex
  255.     
  256.     Set Cam1 = TheView.Camera
  257.     
  258.     Set Vpos = New XVertex
  259.     Set VLookAt = Vpos.Duplicate
  260.     Set VerUp = Vpos.Duplicate
  261.     
  262.     Vpos.X = 1
  263.     Vpos.Y = -1
  264.     Vpos.Z = 1
  265.     
  266.     VLookAt.X = 0
  267.     VLookAt.Y = 0
  268.     VLookAt.Z = 0
  269.     
  270.     VerUp.X = 0
  271.     VerUp.Y = 0
  272.     VerUp.Z = 1
  273.     
  274.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  275.     TheView.ZoomToExtents
  276.     TheView.Refresh
  277.     
  278. Set VerUp = Nothing
  279. Set Vpos = Nothing
  280. Set VLookAt = Nothing
  281. Set Cam1 = Nothing
  282.  
  283. End Sub
  284.  
  285. Public Sub Camera_ISO_NE(TheView As View)
  286.   If (TheView.SpaceMode = imsiPaperSpace) Then
  287.         MsgBox "Camera's properties can be changed only in model space"
  288.         Exit Sub
  289.         'Camera's properties can be changed only in model space
  290.   End If
  291.     Dim Cam1 As XCamera
  292.     Dim Vpos As XVertex
  293.     Dim VLookAt As Vertex
  294.     Dim VerUp As Vertex
  295.     
  296.     Set Cam1 = TheView.Camera
  297.     Set Vpos = New XVertex
  298.     Set VLookAt = Vpos.Duplicate
  299.     Set VerUp = Vpos.Duplicate
  300.     
  301.     Vpos.X = 1
  302.     Vpos.Y = 1
  303.     Vpos.Z = 1
  304.     
  305.     VLookAt.X = 0
  306.     VLookAt.Y = 0
  307.     VLookAt.Z = 0
  308.     
  309.     VerUp.X = 0
  310.     VerUp.Y = 0
  311.     VerUp.Z = 1
  312.     
  313.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  314.     TheView.ZoomToExtents
  315.     TheView.Refresh
  316.     
  317. Set VerUp = Nothing
  318. Set Vpos = Nothing
  319. Set VLookAt = Nothing
  320. Set Cam1 = Nothing
  321. Set Vi = Nothing
  322. Set ActDr = Nothing
  323.  
  324. End Sub
  325.  
  326.  
  327. Public Sub Camera_ISO_SW(TheView As View)
  328.   If (TheView.SpaceMode = imsiPaperSpace) Then
  329.         MsgBox "Camera's properties can be changed only in model space"
  330.         Exit Sub
  331.         'Camera's properties can be changed only in model space
  332.   End If
  333.     Dim Cam1 As XCamera
  334.     Dim Vpos As XVertex
  335.     Dim VLookAt As Vertex
  336.     Dim VerUp As Vertex
  337.     
  338.     Set Cam1 = TheView.Camera
  339.     Set Vpos = New XVertex
  340.     Set VLookAt = Vpos.Duplicate
  341.     Set VerUp = Vpos.Duplicate
  342.     
  343.     Vpos.X = -1
  344.     Vpos.Y = -1
  345.     Vpos.Z = 1
  346.     
  347.     VLookAt.X = 0
  348.     VLookAt.Y = 0
  349.     VLookAt.Z = 0
  350.     
  351.     VerUp.X = 0
  352.     VerUp.Y = 0
  353.     VerUp.Z = 1
  354.     
  355.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  356.     TheView.ZoomToExtents
  357.     TheView.Refresh
  358.     
  359. Set VerUp = Nothing
  360. Set Vpos = Nothing
  361. Set VLookAt = Nothing
  362. Set Cam1 = Nothing
  363.  
  364. End Sub
  365.  
  366.  
  367. Public Sub Camera_ISO_NW(TheView As View)
  368.   If (TheView.SpaceMode = imsiPaperSpace) Then
  369.         MsgBox "Camera's properties can be changed only in model space"
  370.         Exit Sub
  371.         'Camera's properties can be changed only in model space
  372.   End If
  373.     Dim Cam1 As XCamera
  374.     Dim Vpos As XVertex
  375.     Dim VLookAt As Vertex
  376.     Dim VerUp As Vertex
  377.     
  378.     Set Cam1 = TheView.Camera
  379.     
  380.     Set Vpos = New XVertex
  381.     Set VLookAt = Vpos.Duplicate
  382.     Set VerUp = Vpos.Duplicate
  383.     
  384.     Vpos.X = -1
  385.     Vpos.Y = 1
  386.     Vpos.Z = 1
  387.     
  388.     VLookAt.X = 0
  389.     VLookAt.Y = 0
  390.     VLookAt.Z = 0
  391.     
  392.     VerUp.X = 0
  393.     VerUp.Y = 0
  394.     VerUp.Z = 1
  395.     
  396.     Cam1.CameraSetSpaceParameters Vpos, VLookAt, VerUp
  397.     TheView.ZoomToExtents
  398.     TheView.Refresh
  399.     
  400. Set VerUp = Nothing
  401. Set Vpos = Nothing
  402. Set VLookAt = Nothing
  403. Set Cam1 = Nothing
  404. End Sub
  405.  
  406.